
package oreilly.command.control;

/**
 * 模擬將電燈打開<br>
 * <br>
 * Copyright: Copyright (c) 2002-2007<br>
 * Company: E885 有限公司
 * 
 * @author Eric Gau(gau168.gau@msa.hinet.net)
 * @version 1.0
 */
public class LightOnCommand implements Command
{
	/**
	 * 電燈實體
	 */
	private Light light;

	/**
	 * constructor
	 * 
	 * @param light 電燈實體
	 */
	public LightOnCommand( Light light )
	{
		this.light = light;
	}

	/**
	 * 電燈打開( the class was on command )
	 * 
	 * @see Command#execute()
	 */
	public void execute()
	{
		light.turnOn();
	}

	/**
	 * 電燈關閉( the class was off command )
	 * 
	 * @see Command#undo()
	 */
	public void undo()
	{
		light.turnOff();
	}
}
